﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
namespace ChuanPlus
{
    public class Requesting : XPLiteObject
    {
        string fRequestingID;
        [Key]
        [Size(12)]
        public string RequestingID
        {
            get { return fRequestingID; }
            set { SetPropertyValue<string>("RequestingID", ref fRequestingID, value); }
        }
        string fRequestingTo;
        [Size(20)]
        public string RequestingTo
        {
            get { return fRequestingTo; }
            set { SetPropertyValue<string>("RequestingTo", ref fRequestingTo, value); }
        }
        DateTime fRequestingDate;
        public DateTime RequestingDate
        {
            get { return fRequestingDate; }
            set { SetPropertyValue<DateTime>("RequestingDate", ref fRequestingDate, value); }
        }
        Users fApprovedBy;
        public Users ApprovedBy
        {
            get { return fApprovedBy; }
            set { SetPropertyValue<Users>("ApprovedBy", ref fApprovedBy, value); }
        }
        double fTotal;
        public double Total
        {
            get { return fTotal; }
            set { SetPropertyValue<double>("Total", ref fTotal, value); }
        }
        [Association("Requesting-RequestingDetails")]
        public XPCollection<RequestingDetails> RequestingDetails { get { return GetCollection<RequestingDetails>("RequestingDetails"); } }
        string fStatus;
        public string Status
        {
            get { return fStatus; }
            set { SetPropertyValue<string>("Status", ref fStatus, value); }
        }
        public Requesting(Session session) : base(session) { }
        public Requesting() : base(Session.DefaultSession) { }
        public override void AfterConstruction() { base.AfterConstruction(); }
        /// <summary>
        /// Initializes a new instance of the Requesting class.
        /// </summary>
        /// <param name="fRequestingID"></param>
        /// <param name="fRequestingTo"></param>
        /// <param name="fRequestingDate"></param>
        /// <param name="fApprovedBy"></param>
        /// <param name="fTotal"></param>
        public Requesting(string fRequestingID, string fRequestingTo, DateTime fRequestingDate, Users fApprovedBy, double fTotal,string fStatus)
        {
            this.fRequestingID = fRequestingID;
            this.fRequestingTo = fRequestingTo;
            this.fRequestingDate = fRequestingDate;
            this.fApprovedBy = fApprovedBy;
            this.fTotal = fTotal;
            this.fStatus = fStatus;
        }
    }
}
